﻿using EPiServer.Core;
using EPiServer.SpecializedProperties;
using PageTypeBuilder;
using TemplateFoundation.Tabs;

namespace TemplateFoundation.PageTypes
{
    /// <summary>
    /// Used as a data container or presentation page for a contact, such as a contact person
    /// </summary>
    public abstract class ContactPageBase : StandardPageBase, IContactPage
    {
        /// <summary>
        /// Gets or sets the name
        /// </summary>
        /// <remarks>Sort order: 100</remarks>
        [PageTypeProperty(
            EditCaption = "Name",
            HelpText = "The contact's name",
            UniqueValuePerLanguage = false,
            SortOrder = 100,
            Type = typeof (PropertyString),
            Tab = typeof (ContactDetailsTab))]
        public virtual string Name { get; set; }

        /// <summary>
        /// Gets or sets the department
        /// </summary>
        /// <remarks>Sort order: 400</remarks>
        [PageTypeProperty(
            EditCaption = "Department",
            HelpText = "Department name",
            UniqueValuePerLanguage = true,
            SortOrder = 400,
            Type = typeof (PropertyString),
            Tab = typeof (ContactDetailsTab))]
        public virtual string Department { get; set; }

        /// <summary>
        /// Gets or sets the e-mail address
        /// </summary>
        /// <remarks>Sort order: 500</remarks>
        [PageTypeProperty(
            EditCaption = "E-mail address",
            HelpText = "",
            UniqueValuePerLanguage = false,
            SortOrder = 500,
            Type = typeof (PropertyString),
            Tab = typeof (ContactDetailsTab))]
        public virtual string EmailAddress { get; set; }

        /// <summary>
        /// Gets or sets the phone number in a correct format
        /// </summary>
        /// <remarks>Sort order: 600</remarks>
        [PageTypeProperty(
            EditCaption = "Phone number",
            HelpText = "",
            UniqueValuePerLanguage = true,
            SortOrder = 600,
            Type = typeof (PropertyString),
            Tab = typeof (ContactDetailsTab))]
        public virtual string PhoneNumber { get; set; }

        /// <summary>
        /// Gets or sets the image to use as the portrait of the person
        /// </summary>
        /// <remarks>Sort order: 700</remarks>
        [PageTypeProperty(
            EditCaption = "Image",
            HelpText = "Image for the contact, such as a portrait or logo",
            UniqueValuePerLanguage = false,
            SortOrder = 700,
            Type = typeof (PropertyImageUrl),
            Tab = typeof (ContactDetailsTab))]
        public virtual string ContactImage { get; set; }

        /// <summary>
        /// Gets or sets the visiting, or street, address associated with this contact
        /// </summary>
        /// <remarks>Sort order: 1000</remarks>
        [PageTypeProperty(
            EditCaption = "Visiting address",
            HelpText = "The visiting, or street, address for this contact",
            UniqueValuePerLanguage = true,
            SortOrder = 1000,
            Type = typeof(PropertyString),
            Tab = typeof(ContactDetailsTab))]
        public virtual string VisitingAddress { get; set; }

        /// <summary>
        /// Gets or sets the visiting, or street, address associated with this contact
        /// </summary>
        /// <remarks>Sort order: 1100</remarks>
        [PageTypeProperty(
            EditCaption = "Postal address",
            HelpText = "The postal address for this contact",
            UniqueValuePerLanguage = true,
            SortOrder = 1100,
            Type = typeof(PropertyString),
            Tab = typeof(ContactDetailsTab))]
        public virtual string PostalAddress { get; set; }

        /// <summary>
        /// Gets or sets the zip code for the address of this contact
        /// </summary>
        /// <remarks>Sort order: 1200</remarks>
        [PageTypeProperty(
            EditCaption = "Zip code",
            HelpText = "Zip code associated with the address of this contact",
            UniqueValuePerLanguage = true,
            SortOrder = 1200,
            Type = typeof(PropertyString),
            Tab = typeof(ContactDetailsTab))]
        public virtual string ZipCode { get; set; }

        /// <summary>
        /// Gets or sets the city associated with this contact
        /// </summary>
        /// <remarks>Sort order: 1300</remarks>
        [PageTypeProperty(
            EditCaption = "City",
            HelpText = "City associated with this contact",
            UniqueValuePerLanguage = true,
            SortOrder = 1300,
            Type = typeof(PropertyString),
            Tab = typeof(ContactDetailsTab))]
        public virtual string City { get; set; }
    }
}